package com.xiaohe66.web.infrastructure.domain.adapter.love;

import com.xiaohe66.web.domain.love.value.LeaveWordId;
import com.xiaohe66.web.domain.love.value.LeaveWordText;
import com.xiaohe66.web.infrastructure.domain.adapter.DataConverter;

/**
 * @author xiaohe
 * @since 2022.03.30 11:37
 */
public interface LeaveWordConverter extends DataConverter {

    default LeaveWordId newId(Long id) {
        return ifPresent(id, LeaveWordId::new);
    }

    default LeaveWordText newText(String str) {
        return ifPresent(str, LeaveWordText::new);
    }
}
